package org.pettyfox.pfpay.controller.admin;

import org.pettyfox.pfpay.biz.BaseBiz;
import org.pettyfox.pfpay.pojo.ListPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 表格基础接口
 */
//@RestController
public class AdminTableRest<E,T extends BaseBiz> {
     @Autowired
     T biz;
     /**
      * 支持分页，排序，搜索
      * @param map
      * @return
      */
     @GetMapping("listPage")
     Object listPage(ListPage listPage){
          return biz.listPage(listPage);
     }
     @PostMapping("")
     Object createRow(@RequestBody E entity){
          return biz.createRow(entity);
     }
     @PutMapping("")
     Object updateRow(@RequestBody E entity){
          return biz.updateRow(entity);
     }
     @DeleteMapping("{id}")
     Object deleteRow(@PathVariable String id) {
          return biz.deleteRow(id);
     }
}
